<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>模拟 Vue</title>
</head>
<body>
  <div id="app">
    <h1>差值表达式</h1>
    <p>{{ msg }}</p>
    <h1>指令们</h1>
    <h2>v-text</h2>
    <p v-text="msg"></p>
    <p v-text="count"></p>
    <h2>v-model</h2>
    <input type="text" v-model="msg">
    <input type="number" v-model="count">
    <h2>v-html</h2>
    <textarea cols="30" rows="5" v-model="htmlContent"></textarea>
    <div v-html="htmlContent"></div>
    <h2>v-on</h2>
    <input type="text" v-on:change="handleChange">
    <button v-on:click="handleClick">v-on点我一下</button>
    <h2>@</h2>
    <input type="text" @change="handleChange">
    <button @click="handleClick">@方式点我一下</button>
  </div>
  <script src="./js/dep.js"></script>
  <script src="./js/watcher.js"></script>
  <script src="./js/compiler.js"></script>
  <script src="./js/observer.js"></script>
  <script src="./js/vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: '一条普通信息而已',
        count: 100,
        person: {
          name: 'zs'
        },
        htmlContent: '<h6>想你了</h6>'
      },
      methods: {
        handleClick() {
          console.log('点击了一下')
        },
        handleChange() {
          console.log('改变了什么？')
        }
      }
    })
    // console.log(vm.msg, 'msg')
    // vm.msg = 'hello'
    // vm.msg = { student: 'hello' }
  </script>
</body>
</html>